<%@ page language="java" contentType="text/html"
 	import="java.sql.*, javax.sql.*, javax.naming.*"   
 %>
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html">
<title>ID Duplicate Check</title></head>
<body>

<jsp:useBean id="db" class="dataGateway.UserTable" scope="session"/>
<%
	String username = request.getParameter("username");
	int cnt=0;
	
	if( !username.equals("")  && username != null)
	{	
		 cnt = db.userExist(username);
	}
	if(cnt >0)
	{
%>
		<center>
			<%=username %><br> is <font color="red"><b>in use, try again!</b></font><p>
			<input type="button" value="Close" 
          onClick="opener.frm.username.value='';opener.frm.username.focus();window.close();">
		</center>
<%		
	}else{
%>
		<center>
			<%=username %><br> is <font color="green"><b>available!</b></font><p>
			<input type="button" value="Close" 
          onClick="opener.frm.passwd.focus();window.close();opener.frm.idchk.value='y'">
		</center>
<%		
	}
%>
</body>
</html>








